const timeInterval= (start) => {
	const numbers = start.match(/\d+/g).map(Number);
	const startYear = numbers[0];
	//----------------------------------------------------------------------
	const end = new Date()
	const endYear = end.getFullYear()
	//------------------------------------------------------------
	if (+startYear !== +endYear) {
		return (+endYear - +startYear) + '年前'
	}
	const startMonth = numbers[1];
	const endMonth = end.getMonth() + 1
	if (+startMonth !== +endMonth) {
		return (+endMonth - +startMonth) + '个月前'
	}
	const startDay = numbers[2]
	const endDay = end.getDate()
	if (+startDay !== +endDay) {
		return (+endDay - +startDay) + '天前'
	}
	// const startTime = start.substring(11, 19)
	// const startTimeArr = startTime.split(":")
	// const startHour = startTimeArr[0]
	// const endHour = end.getHours()
	// if (+startHour !== +endHour){
	// 	return (+endHour - +startHour) + '小时前'
	// }
	// const startMi = startTimeArr[1]
	// const endMi = end.getMinutes()
	// if (+startMi !== +endMi){
	// 	return (+endMi - +startMi) + '分钟前'
	// }
	return '今天'
}
export default timeInterval